'\" te
.\" Copyright (c) 2006, Sun Microsystems, Inc. All Rights Reserved.
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH NVLIST_REMOVE 9F "Jan 16, 2006"
.SH NAME
nvlist_remove, nvlist_remove_all \- remove name-value pairs
.SH SYNOPSIS
.nf
#include <sys/nvpair.h>

\fBint\fR \fBnvlist_remove\fR(\fBnvlist_t *\fR\fInvl\fR, \fBconst char *\fR\fIname\fR, \fBdata_type_t\fR \fItype\fR);
.fi

.LP
.nf
\fBint\fR  \fBnvlist_remove_all\fR(\fBnvlist_t *\fR\fInvl\fR, \fBconst char *\fR\fIname\fR);
.fi

.SH INTERFACE LEVEL
illumos DDI specific (illumos DDI)
.SH PARAMETERS
.ne 2
.na
\fB\fInvl\fR\fR
.ad
.RS 8n
The list of name-value pairs (\fBnvlist_t\fR) to be processed.
.RE

.sp
.ne 2
.na
\fB\fIname\fR\fR
.ad
.RS 8n
Name of the name-value pair (\fBnvpair\fR) to be removed.
.RE

.sp
.ne 2
.na
\fB\fItype\fR\fR
.ad
.RS 8n
Data type of the \fBnvpair\fR to be removed.
.RE

.SH DESCRIPTION
The \fBnvlist_remove()\fR function removes the first occurrence of \fInvpair\fR
that matches the name and the type.
.sp
.LP
The \fBnvlist_remove_all()\fR function removes all occurrences of \fInvpair\fR
that match the name, regardless of type.
.sp
.LP
Multiple threads can simultaneously read the same \fBnvlist_t\fR but only one
thread may actively change a given \fBnvlist_t\fR at a time. The caller is
responsible for the synchronization.
.SH RETURN VALUES
These functions return \fB0\fR on success and an error value on failure.
.SH CONTEXT
The \fBnvlist_remove()\fR and \fBnvlist_remove_all()\fR functions can be called
from user, interrupt, or kernel context.
.SH ERRORS
.ne 2
.na
\fBEINVAL\fR
.ad
.RS 10n
There is an invalid argument.
.RE

.sp
.ne 2
.na
\fBENOENT\fR
.ad
.RS 10n
No name-value pairs were found to match the criteria specified by name and
type.
.RE

